<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div>1</div>
  <div>2</div>
  <div>3</div>


  <script>
    // var xunhuan = document.querySelectorAll('div')
    var xunhuan = [1, 2, 3]

    // forEach map

    // xunhuan.forEach(function(item, index) {
    //   console.log(item)
    // })

    xunhuan.map(function (item, index) {
      console.log(index)
    })

  </script>
</body>

</html>